﻿<UserControl x:Class="EpiDashboard.Controls.CaseClusterProperties"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Controls="clr-namespace:EpiDashboard.Controls"
              xmlns:EpiDashboard="clr-namespace:EpiDashboard"
             mc:Ignorable="d" 
             d:DesignHeight="460" d:DesignWidth="800" FontFamily="Global User Interface" FontSize="16" Background="White">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../StyleDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="400" MinWidth="300" Width=".33*" />
            <ColumnDefinition Width="30" />
            <ColumnDefinition MinWidth="275" Width=".66*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0"  Background="{StaticResource PrimaryAccentColorLight}" >
            <Border BorderBrush="#015796" BorderThickness="0 0 0 1">
                <Viewbox StretchDirection="DownOnly" Stretch="Uniform" HorizontalAlignment="Left">
                    <Label x:Name="lblConfigExpandedTitle" FontWeight="Light" Foreground="White" FontSize="56" Margin="0, 0, 0, 10">Case Cluster</Label>
                </Viewbox>
            </Border>
        </StackPanel>
        <StackPanel Grid.Column="0" Grid.RowSpan="2" Grid.Row="1" x:Name="panelSidebar" Background="{StaticResource PrimaryAccentColorLight}">
            <Controls:SettingsToggleButton x:Name="tbtnDataSource" Title="Data Source" Description="Choose data source." IsChecked="True" Checked="tbtnDataSource_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnVariables" Title="Variables" Description="Choose map boundaries." IsEnabled="False" IsChecked="False" Checked="tbtnVariables_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnDisplay" Title="Display" Description="Change display options." IsEnabled="False" IsChecked="False" Checked="tbtnDisplay_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnFilters" Title="Filters" Description="Set data filters." IsEnabled="False" IsChecked="False" Checked="tbtnFilter_Checked"/>
        </StackPanel>

        <DockPanel x:Name="panelDataSource" Grid.Column="2" Grid.Row="1" Margin="0, 0, 10, 0" Visibility="Visible">
            <StackPanel DockPanel.Dock="Top">
                <Label x:Name="tblockPanelDataSource" Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Data Source</Label>
                <StackPanel Orientation="Horizontal">
                    <TextBlock FontSize="15"  Foreground="Red" Margin="0 1 0 0 ">*</TextBlock>
                    <TextBlock FontSize="10" Foreground="Red" Margin="3 0 0 10" x:Name="dataSourceRequiredFields"> = Required</TextBlock>
                </StackPanel>
            </StackPanel>

            <ScrollViewer DockPanel.Dock="Bottom" ScrollViewer.VerticalScrollBarVisibility="Auto" >
                <StackPanel Margin="0 0 0 5">
                    <StackPanel x:Name="panelDataSourceProject" Visibility="Visible">
                        <WrapPanel Orientation="Horizontal">
                            <Label x:Name="tblockDataSource">Data Source:</Label>
                            <TextBlock Style="{StaticResource requiredFieldInd}" VerticalAlignment="Top" Margin="2 0 0 0" Text="*">
                                <TextBlock.ToolTip>
                                    <TextBlock x:Name="dataSourceRequiredField">Required field</TextBlock>
                                </TextBlock.ToolTip>   
                         </TextBlock>
                        </WrapPanel>
                        <WrapPanel Orientation="Horizontal">
                            <StackPanel Margin="0 0 20 10">
                                <TextBox TextWrapping="Wrap" MinWidth="250" MaxWidth="600" Style="{StaticResource PropertiesTextBoxLarge}" HorizontalAlignment="Left" x:Name="txtProjectPath" IsReadOnly="True" TextChanged="txtProjectPath_TextChanged"></TextBox>
                            </StackPanel>
                            <StackPanel Margin="0 0 20 0">
                                <Button x:Name="btnBrowse" Height="25" Click="btnBrowse_Click">Browse</Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Background="Transparent" >
                                <EpiDashboard:WaitCursor x:Name="waitCursor" Width="25" Height="25" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" StackPanel.ZIndex="99"/>
                                <TextBlock Margin="5 0 0 0" x:Name="tblockLoadingData" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource PropertiesInstructionsText}" FontSize="10">Loading Data...</TextBlock>
                            </StackPanel>
                        </WrapPanel>
                    </StackPanel>

                    <StackPanel x:Name="panelDataSourceOther" Visibility="Collapsed">
                        <Label x:Name="tblockConnectionString">Connection String:</Label>
                        <TextBox Style="{StaticResource PropertiesTextBoxLarge}" x:Name="txtDataSource" Margin="0,0,0,8" />
                    </StackPanel>

                    <StackPanel x:Name="panelDataSourceAdvanced" Visibility="Collapsed">
                        <Label x:Name="tblockSQLQuery">SQL Query:</Label>
                        <TextBox Style="{StaticResource PropertiesTextBoxLarge}" x:Name="txtSQLQuery"></TextBox>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </DockPanel>

        <DockPanel x:Name="panelVariables" Grid.Column="2" Grid.Row="1" Margin="8" Visibility="Collapsed">

            <StackPanel DockPanel.Dock="Top">
                <Label x:Name="tblockPanelVariables" Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Variables</Label>
                
            </StackPanel>
            <ScrollViewer DockPanel.Dock="Bottom" ScrollViewer.VerticalScrollBarVisibility="Auto" >
                <StackPanel Margin="0 0 0 5">
                    <Label x:Name="tblockSelectVarData" Style="{StaticResource PropertiesSubHeading}" Margin="0, 0, 0, 20">Select the variables for data layer</Label>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock FontSize="15"  Foreground="Red" Margin="0 1 0 0 ">*</TextBlock>
                        <TextBlock FontSize="10" Foreground="Red" Margin="3 0 0 10" x:Name="variablesRequiredFields"> = Required</TextBlock>
                    </StackPanel>
                    <StackPanel>
                        <WrapPanel Orientation="Horizontal">
                            <Label Name="lblLatitude">Latitude Field:</Label>
                            <TextBlock Style="{StaticResource requiredFieldInd}" VerticalAlignment="Top" Margin="2 0 0 0" Text="*">
                                <TextBlock.ToolTip>
                                    <TextBlock x:Name="latitudeRequiredField">Required field</TextBlock>
                                </TextBlock.ToolTip>   
                         </TextBlock>
                        </WrapPanel>
                        <ComboBox HorizontalAlignment="Left" Style="{StaticResource PropertiesComboxStyleMed}" SelectionChanged="cmbLatitude_SelectionChanged" x:Name="cmbLatitude" Width="300" Height="25" ></ComboBox>
                    </StackPanel>
                    <StackPanel Style="{StaticResource FieldSpacer}"></StackPanel>
                    <StackPanel>
                        <WrapPanel Orientation="Horizontal">
                            <Label Name="lblLongitude">Longitude Field:</Label>
                            <TextBlock Style="{StaticResource requiredFieldInd}" VerticalAlignment="Top" Margin="2 0 0 0" Text="*">
                                <TextBlock.ToolTip>
                                    <TextBlock x:Name="longitudeRequiredField">Required field</TextBlock>
                                </TextBlock.ToolTip>   
                         </TextBlock>
                        </WrapPanel>
                        <ComboBox HorizontalAlignment="Left" Style="{StaticResource PropertiesComboxStyleMed}"  IsEnabled="False" x:Name="cmbLongitude" SelectionChanged="cmbLongitude_SelectionChanged" Width="300" ></ComboBox>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </DockPanel>

        <DockPanel x:Name="panelDisplay" Grid.Column="2" Grid.Row="1" Margin="8" Visibility="Collapsed">
            <StackPanel DockPanel.Dock="Top">
                <Label x:Name="tblockPanelDisplay" Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Display</Label>
            </StackPanel>

            <ScrollViewer DockPanel.Dock="Bottom" ScrollViewer.VerticalScrollBarVisibility="Auto" >
                <StackPanel Margin="0 0 0 5">

                    <Label x:Name="tblockTitleNDescSubheader" Style="{StaticResource PropertiesSubHeading}" Margin="0, 0, 0, 5">Description</Label>
                    <Label x:Name="tblockMapDesc">Legend Description:</Label>
                    <TextBox Style="{StaticResource PropertiesGadgetTitle}" HorizontalAlignment="Left" AcceptsReturn="True" TextWrapping="Wrap" x:Name="txtDescription" ></TextBox>
                    <StackPanel Margin="0 26 0 5">
                        <Label x:Name="lblSelectAColor" Style="{StaticResource PropertiesSubHeading}" Margin="0, 10, 0, 0">Select a color</Label>
                        <StackPanel Orientation="Horizontal" >
                            <TextBlock x:Name="tblcolor" Text="Color Representation: "></TextBlock>
                            <StackPanel Style="{StaticResource FieldSpacer}"></StackPanel>
                            <Rectangle x:Name="rctSelectColor" MouseLeftButtonUp="rctSelectColor_MouseLeftButtonUp" HorizontalAlignment="Left"  Height="20" Width="20" Stroke="DarkGray" Cursor="Hand" Fill="#F0FFFFFF" Margin="0,0,11,0">
                                <Rectangle.ToolTip>
                                    <Label Content="select value color"/>
                                </Rectangle.ToolTip>
                            </Rectangle>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </DockPanel>

        <DockPanel x:Name="panelFilter" Grid.Column="2" Grid.Row="1" Margin="8" Visibility="Collapsed"  >
            <StackPanel DockPanel.Dock="Top">
                <Label x:Name="tblockPanelDataFilter" Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Data Filters</Label>
                <Label x:Name="tblockSetDataFilter" Style="{StaticResource PropertiesSubHeading}" Margin="0, 0, 0, 10">Set data filters for this gadget</Label>
                <Label x:Name="tblockAnyFilterGadgetOnly" Margin="0, 0, 0, 20">Note: First select a data source to add a filter to this layer.</Label>
            </StackPanel>
        </DockPanel>

        <DockPanel x:Name="panelInfo" Grid.Column="2" Grid.Row="1" Margin="8" Visibility="Collapsed">
            <StackPanel DockPanel.Dock="Top">
                <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Canvas Information</Label>
            </StackPanel>
            <StackPanel DockPanel.Dock="Bottom">
                <TextBlock x:Name="tblockRows" Text="2,255 unfiltered rows" Margin="0,0,0,16" />
                <TextBlock x:Name="tblockColumns" Text="252 columns" Margin="0,0,0,16" />
                <TextBlock x:Name="tblockCacheDateTime" Text="Data last cached at 12/16/2011 1:56 PM" Margin="0,0,0,16" />
                <TextBlock x:Name="tblockCacheTimeElapsed" Text="Took 4:32:32 to locally cache data" Margin="0,0,0,16" />
                <TextBlock x:Name="tblockCurrentEpiVersion" Text="Epi Info 7.0.0.0" Margin="0,0,0,16" />
            </StackPanel>
        </DockPanel>

        <Button Style="{StaticResource CloseButtonStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8" Click="CloseButton_Click" />

        <DockPanel Grid.ColumnSpan="3" Grid.Row="2">
            <Button x:Name="btnCancel" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8" Width="134" Height="42" Click="btnCancel_Click">Cancel</Button>
            <Button x:Name="btnOK" IsEnabled="false" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8" Width="134" Height="42" Click="btnOK_Click">OK</Button>
        </DockPanel>
    </Grid>
</UserControl>
